#include <stdio.h>
int main()
{
	int x=0, y=1, sum=0, n=0;
	while (n<=4000000){
		n=x+y;
		x=y;
		y=n;
		if (n%2==0){
			sum=sum+n;
		}
	}
	printf("%i\n", sum);
	return 0;
}